body {
  background-color: #0d1117;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #c9d1d9;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
}

#root {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  box-sizing: border-box;
}

.word-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 8px #eee;
  padding: 40px 32px;
  width: 100%;
  max-width: 350px;
  text-align: center;
  margin-top: 40px;
}

.word {
  font-size: 32px;
  font-weight: bold;
  color: #000000;
  margin: 20px 0;
  text-align: center;
}

.phonetic {
  color: #888;
  font-size: 1.2rem;
  margin-bottom: 16px;
}

.definition {
  color: #555;
  font-size: 1.1rem;
  margin-bottom: 24px;
}

.controls {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 24px;
}

.switch-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 1rem;
}

.play-btn {
  background: #e6f0ff;
  color: #2563eb;
  border: none;
  border-radius: 8px;
  padding: 12px 0;
  width: 100%;
  font-size: 1.2rem;
  cursor: pointer;
  margin-top: 16px;
  transition: background 0.2s;
}

.play-btn:hover {
  background: #d0e3ff;
}

.book-selection {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  box-sizing: border-box;
}

.book-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.book-item {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: transform 0.2s;
}

.book-item:hover {
  transform: translateY(-2px);
}

/* 登录页面样式 */
.auth-container {
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  padding: 30px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.auth-container h2 {
  color: #2563eb;
  font-size: 24px;
  margin-bottom: 25px;
  font-weight: 600;
}

.auth-container form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.auth-container input {
  padding: 12px;
  padding-left: 40px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.3s ease;
  background: #f9fafb;
  width: 100%;
  box-sizing: border-box;
}

.auth-container input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.auth-container button {
  padding: 12px;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
}

.auth-container button:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.auth-container button:active {
  transform: translateY(0);
}

/* 添加背景动画 */
.auth-background {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  z-index: -1;
}

/* 添加logo或标题 */
.auth-logo {
  width: 60px;
  height: 60px;
  margin: 0 auto 15px;
  background: #2563eb;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  font-weight: bold;
}

/* 添加输入框图标 */
.input-group {
  position: relative;
  width: 100%;
}

.input-group i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  font-size: 14px;
}

/* 添加错误消息样式 */
.error-message {
  color: #ef4444;
  font-size: 14px;
  margin-top: 5px;
  text-align: left;
}

/* 添加加载和错误状态的样式 */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  font-size: 18px;
  color: #666;
}

.error-container {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  padding: 30px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.error-message {
  color: #ef4444;
  margin-bottom: 20px;
  font-size: 16px;
}

.select-book-btn {
  padding: 12px 24px;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.select-book-btn:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.select-book-btn:active {
  transform: translateY(0);
}

.navigation-buttons {
  display: flex;
  gap: 16px;
  margin-top: 16px;
}

.nav-btn {
  flex: 1;
  padding: 12px 0;
  font-size: 1.2rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #2563eb;
  color: white;
}

.nav-btn:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.nav-btn:active {
  transform: translateY(0);
}

.nav-btn:disabled {
  background: #93c5fd;
  cursor: not-allowed;
  transform: none;
}

.study-container {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.back-to-books-btn {
  position: absolute;
  top: 0;
  left: 0;
  background: #f3f4f6;
  color: #374151;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.back-to-books-btn:hover {
  background: #e5e7eb;
  transform: translateY(-1px);
}

.back-to-books-btn:active {
  transform: translateY(0);
}

.sentence {
  margin: 15px 0;
  font-size: 16px;
  color: #333;
  line-height: 1.5;
}

.sentence-trans {
  margin: 5px 0 15px;
  font-size: 14px;
  color: #666;
  line-height: 1.5;
}

/* 全局样式 */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #0d1117;
  color: #c9d1d9;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  box-sizing: border-box;
}

/* 容器居中样式 (保持原有居中，但更新颜色) */
.main-container,
.study-container,
.login-container,
.book-selection-container,
.error-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 1000px;
  margin: 20px auto;
  padding: 20px;
  box-sizing: border-box;
}

/* 登录容器 */
.login-container {
  background-color: #161b22;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(0, 123, 255, 0.4),
              0 0 40px rgba(0, 123, 255, 0.2);
  padding: 40px;
  width: 100%;
  max-width: 450px;
  text-align: center;
  animation: fadeIn 1s ease-in-out;
  border: 1px solid #007bff;
}

.login-box h2 {
  color: #007bff;
  font-size: 2.2em;
  margin-bottom: 30px;
  text-shadow: 0 0 8px rgba(0, 123, 255, 0.7);
  letter-spacing: 1px;
}

.input-group {
  margin-bottom: 20px;
  text-align: left;
}

.input-group label {
  display: block;
  margin-bottom: 8px;
  color: #8b949e;
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-group input {
  width: calc(100% - 20px);
  padding: 12px 10px;
  background-color: #0d1117;
  border: 1px solid #30363d;
  border-radius: 8px;
  color: #c9d1d9;
  font-size: 1em;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.input-group input:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.3);
  outline: none;
}

.login-btn {
  background-color: #007bff;
  color: white;
  padding: 14px 25px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1em;
  font-weight: bold;
  transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
  width: 100%;
  margin-top: 20px;
  box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
}

.login-btn:hover {
  background-color: #0056b3;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 123, 255, 0.4);
}

.message {
  margin-top: 20px;
  font-size: 0.9em;
  color: #ff6b6b;
}

.register-link {
  background: none;
  border: none;
  color: #007bff;
  cursor: pointer;
  font-size: 0.9em;
  margin-top: 20px;
  transition: color 0.3s ease;
}

.register-link:hover {
  color: #66b3ff;
  text-decoration: underline;
}

/* 动画效果 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.no-books-message {
  font-size: 1.2em;
  color: #c9d1d9; /* 科技感文本颜色 */
  text-align: center;
  margin-top: 50px;
  padding: 20px;
  border: 1px dashed #007bff; /* 虚线边框，增加科技感 */
  border-radius: 8px;
  background-color: #161b22; /* 稍深的背景 */
  box-shadow: 0 0 10px rgba(0, 123, 255, 0.3); /* 发光效果 */
}

/* 书本卡片正在学习状态 */
.book-card.is-learning {
  /* 调整颜色，使其看起来像被禁用或已选择 */
  background-color: #21262d; /* 更深的背景 */
  border-color: #30363d; /* 更暗的边框 */
  opacity: 0.7; /* 稍微透明 */
  box-shadow: none; /* 移除发光效果 */
}

/* 正在学习的文本提示 */
.learning-status {
  display: block;
  margin-top: 10px;
  font-size: 0.9em;
  color: #007bff; /* 亮蓝色 */
  font-weight: bold;
}

/* 书本选择页面容器 */
.book-selection-container {
  /* 保持与之前全局居中设置一致，但确保其内容能流式布局 */
  display: flex; /* 使用flexbox来居中h2和book-list */
  flex-direction: column; /* 垂直排列子元素 */
  align-items: center; /* 水平居中 */
  width: 100%;
  max-width: 1000px; /* 统一最大宽度 */
  margin: 20px auto;
  padding: 20px;
  box-sizing: border-box;
  background-color: #161b22; /* 与登录框相似的背景 */
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(0, 123, 255, 0.2), /* 蓝色发光阴影 */
              0 0 40px rgba(0, 123, 255, 0.1);
  position: relative;
}

.book-selection-container h2 {
  color: #007bff; /* 标题颜色 */
  font-size: 2.2em;
  margin-bottom: 30px;
  text-shadow: 0 0 8px rgba(0, 123, 255, 0.7);
  letter-spacing: 1px;
}

/* 书本列表容器 - 使用 Grid 布局 */
.book-list {
  display: grid;
  /* 自动填充列，每列最小宽度280px，最大1fr */
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
  gap: 25px; /* 卡片之间的间距 */
  width: 100%; /* 列表宽度填充父容器 */
  justify-content: center; /* 在容器中居中网格项 */
  padding: 10px; /* 列表内部的内边距 */
}

/* 单个书本卡片 */
.book-card {
  background-color: #0d1117; /* 卡片深色背景 */
  border: 1px solid #007bff; /* 亮蓝色边框 */
  border-radius: 10px;
  padding: 25px;
  box-shadow: 0 0 15px rgba(0, 123, 255, 0.3); /* 发光效果 */
  text-align: left; /* 内容左对齐 */
  cursor: pointer; /* 表示可点击 */
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* 标题和描述之间留白 */
  min-height: 150px; /* 最小高度，保证卡片大小一致 */
  position: relative;
}

.book-card:hover:not(.is-learning) { /* 悬停效果，如果不是"正在学习"状态 */
  transform: translateY(-5px); /* 向上微移 */
  box-shadow: 0 0 25px rgba(0, 123, 255, 0.6); /* 更强的发光 */
  background-color: #1a2027; /* 悬停时背景稍亮 */
}

.book-card h3 {
  color: #c9d1d9; /* 标题颜色 */
  font-size: 1.5em;
  margin-top: 0;
  margin-bottom: 10px;
}

.book-card p {
  color: #8b949e; /* 描述文字颜色 */
  font-size: 0.9em;
  line-height: 1.5;
  flex-grow: 1; /* 描述内容占据更多空间 */
}

/* 书本卡片正在学习状态的样式（如果之前有，请替换） */
.book-card.is-learning {
  background-color: #21262d; /* 更深的背景 */
  border-color: #30363d; /* 更暗的边框 */
  opacity: 0.8; /* 稍微透明 */
  box-shadow: none; /* 移除发光效果 */
  cursor: not-allowed; /* 不可点击的光标 */
}

.learning-status {
  display: block;
  margin-top: 15px;
  font-size: 1em;
  color: #007bff; /* 亮蓝色 */
  font-weight: bold;
  text-align: right; /* "正在学习"文字右对齐 */
  padding-top: 10px;
  border-top: 1px solid #30363d; /* 上方细线分隔 */
}

.book-card.learning {
  border: 2px solid #4CAF50;
  background-color: rgba(76, 175, 80, 0.1);
}

.learning-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: #4CAF50;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.logout-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  padding: 8px 16px;
  background-color: #f44336;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s;
}

.logout-btn:hover {
  background-color: #d32f2f;
}

.sentence-container {
  margin: 15px 0;
  padding: 15px;
  background-color: #f5f5f5;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sentence {
  margin-bottom: 8px;
  font-size: 16px;
  color: #333;
  line-height: 1.5;
}

.sentence-trans {
  font-size: 14px;
  color: #666;
  line-height: 1.5;
} 